package br.com.massai.model.entity;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.SequenceGenerator;

@Entity
@SequenceGenerator(name = "seqObra", sequenceName = "seq_obra", allocationSize = 1)
@NamedQueries({@NamedQuery(name = "Obra.findAll", query = "SELECT o FROM Obra o")})
public class Obra implements Serializable {

	private static final long serialVersionUID = 2180202261621875322L;

	@Id
	@Column(name = "ID_OBRA")
	@GeneratedValue(generator = "seqObra", strategy = GenerationType.SEQUENCE)
	private Long id;

	@Column(name = "DESCRICAO", nullable = false, columnDefinition = "VARCHAR(100)")
	private String descricao;

	@ManyToOne(fetch = FetchType.LAZY)
	private GrupoProducao grupoProducao;

	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public String getDescricao() {
		return descricao;
	}

	public void setDescricao(String descricao) {
		this.descricao = descricao;
	}

	public GrupoProducao getGrupoProducao() {
		return grupoProducao;
	}

	public void setGrupoProducao(GrupoProducao grupoProducao) {
		this.grupoProducao = grupoProducao;
	}
}
